package top.hidoctor.auscultation.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import top.hidoctor.auscultation.R;
import top.hidoctor.auscultation.bean.LableBean;

public class YishengBzAdapter extends BaseQuickAdapter<LableBean.LabelUserSamplesBean> {
    public YishengBzAdapter(int layoutResId, List<LableBean.LabelUserSamplesBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LableBean.LabelUserSamplesBean item) {
        //状态:10:标注开始；20：标注完成;30:标注超时
        helper.setText(R.id.tv_name, TextUtils.isEmpty(item.getLabelName()) ? "" : item.getLabelName())
                .setText(R.id.tv_status, item.getStatus() == 10 ? "标注开始" : item.getStatus() == 20 ? "标注完成" : item.getStatus() == 30 ? "标注超时" : "")
                .setTextColor(R.id.tv_status, item.getStatus() == 10 ? mContext.getResources().getColor(R.color.main_yellow) : item.getStatus() == 20 ? mContext.getResources().getColor(R.color.blue_main) : item.getStatus() == 30 ? mContext.getResources().getColor(R.color.red_main) : null)
                .setBackgroundRes(R.id.tv_status, item.getStatus() == 10 ? R.drawable.bg_yellow_8_2 : item.getStatus() == 20 ? R.drawable.bg_blue_8_2 : item.getStatus() == 30 ? R.drawable.bg_red_8_2 : null);
    }
}
